package com.etc.service;


import com.etc.dao.StaffDao;
import com.etc.entity.Staff;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class StaffService {
    @Autowired
    private StaffDao staffDao;

    /**
     * 查询全部
     *
     * @param
     * @return
     */
    public List<Staff> findAll() {
        try {
            return staffDao.findAll();
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }

    public Integer add(Staff staff) {
        try {
            return staffDao.add(staff);
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }

    }

    public Staff findid(Integer id) {
        try {
            return staffDao.findid(id);
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }

    public Integer deleteId(Integer id) {
        try {
            return staffDao.deleteId(id);
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }

    public Integer updateid(Staff staff) {
        try {
            return staffDao.updateid(staff);
        }catch (Exception e){
            e.printStackTrace();
            return null;
        }
    }
}

